//
//  AudioPlayer.h
//  MusicPlayer
//
//  Created by lanou3g on 15/9/17.
//  Copyright (c) 2015年 Jenney. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Singleton.h"

@class AudioPlayer;

@protocol AudioPlayerDelegate <NSObject>

//播放过程中
- (void)audioPlayer:(AudioPlayer *)player playingWithProgress:(float)progress;

//播放结束
- (void)audioPlayerDidFinish:(AudioPlayer *)player;

@end


@interface AudioPlayer : NSObject
singleton_interface(AudioPlayer)

@property (nonatomic,assign)id<AudioPlayerDelegate> delegate;
@property (nonatomic,assign)BOOL isPlaying;
@property (nonatomic, assign) float volume;


// 根据url播放音乐
- (void)setPreparePlayMusicURLStr:(NSString *)urlStr;

// 播放
- (void)play;

// 暂停
- (void)pause;

// 停止
- (void)stop;

// 设置音量
- (void)setVolume:(float)volume;

// 获取音量
- (float)volume;

// 获取播放时间
- (void)seekToTime:(float)time;





@end
